/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.pa165.carpark.servicies;

import cz.muni.fi.pa165.carpark.EmployeePosition;
import cz.muni.fi.pa165.carpark.TO.ServiceCheckTO;
import cz.muni.fi.pa165.carpark.TO.VehicleTO;
import cz.muni.fi.pa165.carpark.VehicleStatus;
import java.util.List;
import javax.jws.WebParam;
import javax.jws.WebService;

/**
 *
 * @author xmarton1
 */
@WebService
public interface VehicleService {
    
    /*
     * Creates new Vehicle entity in database
     * 
     * @param vehicle VehicleDTO to create
     * @throws DataAccessResourceFailureException in case some error od persistence layer.
     */
    void create(@WebParam(name = "vehicle") VehicleTO vehicle); 
    
    /*
     * Retrieves VehicleDTO from database
     * 
     * @param id Id of retrieved Vehicle
     * @return VehicleDTO 
     * @throws DataRetrievalFailureException in case some error od persistence layer.
     */
    VehicleTO retrieve(@WebParam(name = "id") Long id);
    
    /*
     * Updates VehicleTO 
     * @param vehicle VehicleDTO  to update
     * @throws DataAccessResourceFailureException in case some error od persistence layer.
     */
    void update(@WebParam(name = "vehicle") VehicleTO vehicle);
    
    /*
     * Deletes vehicle entity from database
     * @param vehicle VehicleDTO to be deleted
     * @throws DataAccessResourceFailureException in case some error od persistence layer.
     */
    void delete(@WebParam(name = "vehicle") VehicleTO vehicle);
    
    /*
     * Return all Vehicles with selected status
     * @param status = VehicleStatus
     */
    List<VehicleTO> getVehiclesByStatus(VehicleStatus status);
    
    /*
     * Return all VecicleDTO that are available for given position.
     * @return List<VehicleDTO> List of all available vehicles for given position.
     * @throws DataAccessResourceFailureException in case some error od persistence layer.
     */
    List<VehicleTO> retrieveAllVehiclesForPosition(@WebParam(name = "position") EmployeePosition position);
    
    /*
     * Return all VecicleDTO.
     * @return List<VehicleDTO> List of all vehicles.
     * @throws DataAccessResourceFailureException in case some error od persistence layer.
     */
    List<VehicleTO> retrieveAllVehicles();
    
    /**
     *
     * @param vehicle
     * @param active
     * @return
     */
    public List<ServiceCheckTO> getActiveServiceChecks(VehicleTO vehicle,boolean active);
    
    
}
